//#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "adminActions\fn_markerModeAction.sqf"
#include <core_macros.h>

TRACE_1("Start",_this);
TMFPROFILERSTART;

private ["_is_active","_action_id"];
PARAMS_1(_is_active);
_action_id = GVAR(MarkerAction);

TRACE_1("Input",ARR_2(_is_active,_action_id));
if (_action_id >= 0) then {
	if (!_is_active) then {
		player removeAction _action_id;
		GVAR(MarkerAction) = -1;
		TRACE_1("Action Removed",GVAR(MarkerAction));
	};
} else {
	if (_is_active) then {
		_action_id = player addAction [GREEN_TEXT("Marker Mode"),"tmf\core\addAction.sqf",[[],FUNC(markerMode)],-5,false,true];
		GVAR(MarkerAction) = _action_id;
		TRACE_1("Action Added",GVAR(MarkerAction));
	};
};

TRACE_2("End",GVAR(MarkerMode),GVAR(MarkerAction));
TMFPROFILERSTOP;
